package com.csd.action.manager;

import com.csd.helper.ActionResult;
import com.csd.service.IProjectTypeService;

/**
 * 项目类别启动或关闭
 * @author sanmu
 *	<br> 创建于2009-12-17
 */
public class ProjectTypeChangeAction {

	private Integer projectTypeID;
	
	/** 操作类型，1为启动，0为关闭 */
	private String actionType;
	
	private IProjectTypeService projectTypeService;
	
	public Integer getProjectTypeID() {
		return projectTypeID;
	}

	public void setProjectTypeID(Integer projectTypeID) {
		this.projectTypeID = projectTypeID;
	}

	public String getActionType() {
		return actionType;
	}

	public void setActionType(String actionType) {
		this.actionType = actionType;
	}

	public IProjectTypeService getProjectTypeService() {
		return projectTypeService;
	}

	public void setProjectTypeService(IProjectTypeService projectTypeService) {
		this.projectTypeService = projectTypeService;
	}

	public String execute() throws Exception {
		//System.out.println("======555555555555555555555=="+projectTypeID);
		String text = ActionResult.fail;
		boolean bl = false;
		boolean isEnable = false;
		if (actionType !=null && Integer.parseInt(actionType)==1) {
			isEnable = true;
		}
		//改变项目类型状态   项目类别启动或关闭
		bl = projectTypeService.changeProjectType(projectTypeID, isEnable);
		text = ActionResult.success;
		return text;
	}
}
